package com.jbl.gof23.create.prototype;

import java.util.Date;

/**
 * 克隆原型对象
 */
public class Clone {
    public static void main(String[] args) throws CloneNotSupportedException, InterruptedException {
        Video video = new Video("11",new Date());
        System.out.println(video+"===="+video.hashCode());

        //克隆原型对象(此时是浅克隆，克隆的是地址值)
        Video clone = (Video)video.clone();
        Thread.sleep(1000L);
        video.setCreateTime(new Date());
        System.out.println(video+"===="+video.hashCode());
        System.out.println(clone+"===="+clone.hashCode());
    }
}


